package com.yonyou.crm.sprc.oppaction.rmimpl;

import com.yonyou.crm.common.page.entity.Page;
import com.yonyou.crm.sprc.oppaction.entity.OppactionVO;
import com.yonyou.crm.sprc.oppaction.rmitf.IOppactionRmService;
import com.yonyou.crm.sprc.oppaction.service.OppactionBizServiceImpl;
import com.yonyou.crm.sprc.oppdimension.entity.OppdimensionVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service("oppactionService")
public class OppactionRmServiceImpl implements IOppactionRmService {

	@Autowired
	private OppactionBizServiceImpl service;

	@Override
	public Page<OppactionVO> getList(Page<OppactionVO> requestPage, Map<String, Object> searchMap) {
		return service.getList(requestPage, searchMap);
	}

	@Override
	public OppactionVO detail(String id) {
		// TODO 自动生成的方法存根
		return null;
	}

	@Override
	public OppactionVO insert(OppactionVO vo) {
		OppactionVO oppactionVO = service.saveVO(vo);
		return service.getOppactionVOById(oppactionVO.getId());
	}

	@Override
	public OppactionVO update(OppactionVO vo) {
		OppactionVO oppactionVO = service.updateVO(vo);
		oppactionVO = service.getOppactionVOById(oppactionVO.getId());
		return oppactionVO;
	}

	@Override
	public Page<OppactionVO> batchDelete(String[] idArray, Page<OppactionVO> requestPage, Map<String, Object> searchMap) {
		service.batchDeleteByIDs(OppactionVO.class, idArray);
		return service.getList(requestPage, searchMap);
	}

	@Override
	public Page<OppactionVO> batchUpdateEnableState(String[] idArray, Integer enableState, Page<OppactionVO> requestPage, Map<String, Object> searchMap) {
		service.batchUpdateEnableState(idArray, enableState);
		return service.getList(requestPage, searchMap);
	}
	@Override
	public List<OppactionVO> getByDimension(List dimIds){
		return service.getByDimension(dimIds);
	}

}
